package com.mo.ld.activity.view

import android.os.Bundle
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mo.ld.R
import com.mo.ld.databinding.ActFlowlayoutBinding
import com.mo.lib.ui.activity.BaseVbActivity
import com.mo.lib.view.recyclerview.layoutTagFlow

/**
 * @ author：mo
 * @ data：2022/4/26:14:53
 * @ 功能：
 */
class FlowLayoutActivity : BaseVbActivity<ActFlowlayoutBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
//        viewBinding.tagFlow.adapter = object : TagAdapter<String>(arrayListOf("张三", "李四", "王二麻子", "赵钱", "孙李", "樊二狗子")) {
//            override fun getView(var1: FlowLayout?, var2: Int, var3: String?): View {
//                val view = getView(R.layout.item_tag)
//                var tv = view.findViewById<TextView>(R.id.tv_item_tag)
//                tv.text = var3
//                return view
//            }
//        }
        viewBinding.krvTag.layoutTagFlow(10).adapter = object : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_tag, arrayListOf("张三", "李四", "王二麻子", "赵钱", "孙李", "樊二狗子")) {
            override fun convert(holder: BaseViewHolder, bean: String) {
                val view = holder.getView<TextView>(R.id.tv_item_tag)
                view.text = bean
            }
        }
    }

    override fun initData() {
    }
}